<extend name="./Common/View/Public/statics.html"/>
<block name="page_title">结果统计</block>
<block name="main">
    <div class="layui-row">
        <div class="layui-col-xs12">
            <div class="layui-inline">
                <form id="pageForm" class="layui-form" lay-filter="pageForm">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <select name="project_id" id="project_id" lay-filter="project_id" value="{$Think.get.project_id}" api="rate/project/slist" affect="reload" empty="项目"></select>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div id="test" style="width: 600px;height:400px;"></div>
</block>
<block name="script">
    <script>
        <notempty name="data">
        var myChart = echarts.init(document.getElementById('test'));
        var option = {
            title: {
                text: '评价结果统计',
                x:'center'
            },
            tooltip: {
                trigger: 'item',
                formatter: "{a} <br/>{b} : {c} ({d}%)"
            },
            legend: {
                orient: 'vertical',
                left: 'left',
                data: {:json_encode($data['legend'])}
            },
            series: [{
                name: '评价结果',
                type: 'pie',
                data: {:json_encode($data['series'])},
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                                shadowOffsetX: 0,
                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }]
        };
        myChart.setOption(option);
        </notempty>
    </script>
</block>